/*
 * @Author: Zhangxx 2425792130@qq.com
 * @Date: 2024-06-28 16:21:42
 * @LastEditors: restart 2425792130@qq.com
 * @LastEditTime: 2024-07-23 16:49:16
 * @FilePath: \geek-pc\src\App.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 导入路由
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { AuthRoute } from './components/AuthRoute'
import {history,HistoryRouter} from './utils/history'
// 导入页面组件
import Login from './pages/login'
import GeekLayout from './pages/layout'
import Home from './pages/home'
import Article from './pages/article'
import Publish from './pages/publish'
import List from './pages/list'
import Paper from './pages/paper'
import './index.css'
// 配置路由规则
function App() {
  return (
    // </BrowserRouter>
    // <BrowserRouter>
    <HistoryRouter history={history}>
    <div className="App">
       <Routes>
             {/* 需要鉴权的路由 */}
          {/* <Route path="/*" element={
            <AuthRoute>
              <Layout />
            </AuthRoute>
          } /> */}
          <Route path="/" element={
             <AuthRoute>
             <GeekLayout />
             </AuthRoute>
           }>
           {/* 二级路由默认页面 */}
           <Route index element={<Home />} />
           <Route path="article" element={<Article />} />
           <Route path="publish" element={<Publish />} />
           <Route path="list" element={<List />} />
           <Route path="paper" element={<Paper />} />
          </Route>
          {/* 不需要鉴权的路由 */}
          <Route path='/login' element={<Login />} />
        </Routes>
      </div>
    </HistoryRouter>
      
  )
}

export default App
